﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fibonacci
{
    class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("想知道数列的第几项");
            int n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("数列第{0}项为{1}", n, FB(n));
            Console.ReadKey();
        }
        static int FB(int n)
        {
            int i, temp;
            int a = 1, b = 1;
            for (i = 3; i <= n; i++)
            {
                temp = b;
                b = a + b;
                a = temp;
            }
            return b;
        }
    }
}

